package com.ddx.common.util;

import org.apache.commons.lang3.StringUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

/**
 * @author dudianbo
 * @ClassName: ${CLASSNAME}
 * @Description: ${DESCRIPTION}
 * @date 2018/4/25
 */
public class AssertUtil extends Assert {

    public static void isNotNull(@Nullable Object object, String message) {

            //校验参数是否为null
            notNull(object, message);
            //如果数据类型为String，需要判断空串
            if (object instanceof String) {
                String s = (String) object;
                if (StringUtils.isBlank(s)) {
                    throw new IllegalArgumentException(message);
                }
            }

    }
}
